#!/usr/bin/python

'''
Randomizes lines in an input file.
'''

from random import shuffle

TO_RAND = 'data_norm'
RAND_OUT = 'data_norm_rand'
EXCLUDE = 2


def main():
    infile = open(TO_RAND)
    outfile = open(RAND_OUT, 'wb')
    for i in range(0, EXCLUDE):
        outfile.write(infile.readline())
    lines = infile.readlines()
    shuffle(lines)
    for line in lines:
        outfile.write(line)
    infile.close
    outfile.close()


if __name__ == "__main__":
    main()
